Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 🐛 Fixed ToolTip Slide Transition #369

Merged
merged 1 commit into from
Apr 18, 2024

Conversation

faiyaz-shaikh
Copy link
Contributor

@faiyaz-shaikh faiyaz-shaikh commented Apr 6, 2023

Description

Fixed ToolTip Slide Transition

  • Added toolTipSlideEndDistance to define motion range for tooltip slide animation.
  • Added the ToolTipSlideTransition widget and removed SlideTransition to fix the sliding range issue because before sliding range increased as child's size increased

Checklist

  • The title of my PR starts with a Conventional Commit prefix (fix:, feat:, docs: etc).
  • I have followed the Contributor Guide when preparing my PR.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples or docs.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

Related Issues

@@ -589,3 +590,18 @@ class _Arrow extends CustomPainter {
oldDelegate.strokeWidth != strokeWidth;
}
}

class ToolTipSlideTransition extends AnimatedWidget {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is getting very big now, can you please saparate code in multiple files.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

: const Offset(0.0, 0.100),
begin: const Offset(0.0, 0.0),
end: Offset(
0.0, widget.movingEndDistance * contentOffsetMultiplier),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comma

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

top: paddingTop,
),
padding:
EdgeInsets.only(top: paddingTop, bottom: paddingBottom),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^^

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

end: const Offset(0.0, 0.100),
begin: const Offset(0.0, 0.0),
end: Offset(
0.0, widget.movingEndDistance * contentOffsetMultiplier),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please reformat this for better readability

@Sahil-Simform Sahil-Simform force-pushed the fix/tooltip_slide_transition branch 2 times, most recently from 64f8423 to 4ef1d97 Compare March 8, 2024 12:44
@@ -247,6 +247,13 @@ class Showcase extends StatefulWidget {
/// Disables barrier interaction for a particular showCase.
final bool disableBarrierInteraction;

/// Define End distance of tooltip position when tooltip is moving.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please improve wording.

@@ -247,6 +247,13 @@ class Showcase extends StatefulWidget {
/// Disables barrier interaction for a particular showCase.
final bool disableBarrierInteraction;

/// Define End distance of tooltip position when tooltip is moving.
///
/// Which is from 0 to movingEndDistance (positive)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please mention it as the motion range for tooltip slide animation.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, since it is mentioned positive here, please check with negative value and add assertion of the polarity if positive value is absolutely required.

@@ -292,6 +299,7 @@ class Showcase extends StatefulWidget {
this.descriptionTextDirection,
this.onBarrierClick,
this.disableBarrierInteraction = false,
this.toolTipSlideEndDistance = 7.0,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can omit the .0.

end: !widget.showArrow && !isArrowUp
? const Offset(0.0, 0.0)
: const Offset(0.0, 0.100),
begin: const Offset(0.0, 0.0),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use Offset.zero here.


@override
Widget build(BuildContext context) =>
Transform.translate(offset: _progress.value, child: child);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please improve format for better readability.


final Widget child;

Animation<Offset> get _progress => listenable as Animation<Offset>;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this variable is only used in the build method, you can create it there only instead of this getter.

@Sahil-Simform Sahil-Simform force-pushed the fix/tooltip_slide_transition branch 7 times, most recently from e76f490 to abdcd00 Compare March 12, 2024 07:00
Copy link

@Ujas-Majithiya Ujas-Majithiya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

Copy link
Collaborator

@Sahil-Simform Sahil-Simform left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@ujas-m-simformsolutions ujas-m-simformsolutions left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

- Added `toolTipSlideEndDistance` to define motion range for tooltip slide animation.
- Added `ToolTipSlideTransition` widget and removed `SlideTransition` to fix sliding range issue because before sliding range is increasing as child's size increase
@aditya-css aditya-css merged commit 6ed6e03 into master Apr 18, 2024
2 checks passed
@aditya-css aditya-css deleted the fix/tooltip_slide_transition branch April 18, 2024 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants